<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
        *{
            margin: 0;
            padding: 0;
        }
        body{
            margin: 10px;
        }
        .title{
            line-height: 40px;
            font-weight: 700;
        }
        .list .item{
            display: flex;
            /* justify-content: space-between; */
            align-items: center;
            font-size: 12px;
            margin-bottom: 10px;

        }
        .list .item img{
            width: 100px;
            border-radius: 5px;
        }
        .list .item .middle .name{
            font-weight: 700;
            font-size: 16px;
            margin-bottom: 5px;
        }
        .list .item .middle .desc{
            color: red;
            margin-bottom: 5px;
            font-weight: 700;

            
        }

        .list .item .pic2{
            width: 15px;

        }
        .list .item .middle span{
            color: red;
            

        }
        .list .item .middle .a{
            color: gray;
            margin: 5px 0;
        }
        .list .item .middle{
            width: 200px;
            margin: 0 20px;
        }
        .right button{
            background-color: orangered;
            border-radius: 15px;
            border: 0;
            padding: 5px 15px;
            color: white;
        }



        
</style>
<body>
    <div id="app">
        <div class="title">热门单品</div>
        <div class="list">
            <div class="item" v-for="(item,index) in tasklist" v-bind:key="index">
                <div class="left">
                    <img v-bind:src="item.pic" alt="">
                </div>
                <div class="middle">
                    <div class="name"> {{item.name}} </div>
                    <div class="desc"> {{item.desc}} </div>
                    <img v-bind:src="item.pic" class="pic2">
                    <span> {{item.b}} </span>
                    <div class="a"> {{item.a}} </div>
                </div>
                <div class="right">
                    <button>{{item.status==1?'立即兑':'不兑换'}}</button>
                </div>
            </div>
        </div>
    </div>

</body>

</html>
<script src="./vue-2.5.21.js"></script>
<script>
    //实例化Vue对象
    var v = new Vue({
        el: '#app',//el 表示Vue实例挂载的dom节点，id选择器
        data: {
            tasklist: [
                { id: 1, pic:'./pic.png', name: '脐橙三斤 快递到家', desc: '兑换后入手价8.9元', b:'10', a:'适用门店>',status: 1 },
                { id: 2, pic:'./pic.png', name: '耙耙柑2斤 快递到家', desc: '兑换后入手价9.9元', b:'10', a:'适用门店>',status: 1 },
                { id: 3, pic:'./pic.png', name: '水果捞350g', desc: '兑换后入手价6.9元',b:'10', a:'适用门店>',status: 1 },
            ]
        },//data 定义响应式数据，data的类型可以是对象，也可以是函数
        // data:function(){return{}} 两种写法
        computed: {},//定义计算属性
        watch: {},//定义数据监听
        methods: {},//定义方法(函数)
        filters: {},//定义过滤器
        directives: {},//定义自定义指令
        components: {},//注册局部组件
    })
    //接下来使用VueJS的声名式编程语法，实现<数据驱动试图更新>

</script>